//
//  FYComposeTextView.swift
//  dugeweibo
//
//  Created by pelesys on 16/8/7.
//  Copyright © 2016年 杜方宜. All rights reserved.
//

import UIKit
import SnapKit
class FYComposeTextView: UITextView {

  
    // MARK:-懒加载属性
    lazy var placeHolderLabel : UILabel = UILabel()
    // MARK:-构造属性
//    override func drawRect(rect: CGRect) {
//        // Drawing code
//    }
      // MARK:-构造属性
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }

}
//MARK: -设置UI界面
extension FYComposeTextView{
    private func setupUI(){
        //1.添加子控件
        addSubview(placeHolderLabel)
        //2.设置frame
        placeHolderLabel.snp_makeConstraints { (make) in
            make.top.equalTo(8)
            make.left.equalTo(10)
        }
        //3.设置placeholderLabel属性
        placeHolderLabel.textColor = UIColor.lightGray
        placeHolderLabel.font = font
        //4.设置placeholederLabel文字
        placeHolderLabel.text = "分享新鲜事..."
        //5.设置内容的内边距
        textContainerInset = UIEdgeInsets(top: 6, left: 7, bottom: 0, right: 0)
    }
}
